package _Trash;

import java.io.IOException;
import java.util.ArrayList;

import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.store.LockObtainFailedException;

public class ParseTester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		

		BOMParser bomParser = new BOMParser();
	//	NTParser ntparser = new NTParser();

		try {
			IndexWriter indexer = new IndexWriter("index", new StandardAnalyzer(),true);
				String collection = "rel200/bom/bom.xml";
				System.out.println("Indexing: "+collection);

				ArrayList<Document> docs = bomParser.parse(collection);

				for(Document d : docs) {
					indexer.addDocument(d);
				}
			System.out.println("Optimizing...");
			indexer.optimize();
			indexer.close();
		} catch (CorruptIndexException e) {
			e.printStackTrace();
		} catch (LockObtainFailedException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		
		System.out.println("---END---");



	}

}

